package com.suixinsanren.algorithm.sort.bubble.demo02;

import org.junit.Test;

import java.util.Arrays;
import java.util.Random;

public class BubbleTestDrive {

    private final int[] arr = new int[10];
    private final Random random = new Random();

    //    @Before
    public void init() {
        for (int i = 0; i < arr.length; i++) {
            arr[i] = random.nextInt(10);
        }
        System.out.println(Arrays.toString(arr));
    }

    @Test
    public void eachTest() {
        for (int i = 0; i < 20; i++) {
            init();
            testSort();
            printArr();
        }
    }

    @Test
    public void testSort() {
        BubbleSort02.sort(arr);
    }

    //    @After
    public void printArr() {
        System.out.println(Arrays.toString(arr));
        System.out.println("----------------------------------------");
    }


}
